<extend name="Public/base" />

<!-- 子导航 -->
<block name="sidebar">
	<include file="sidemenu" />
</block>

<block name="body">
	<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
	<div class="main-title cf">
		<h2>
			写跟进
		</h2>
	</div>
	<!-- 标签页导航 -->
	<div class="tab-wrap">
		<div class="tab-content">
			<!-- 表单 -->
			<form id="form" action="__SELF__" method="post" class="form-horizontal">
				<!-- 基础文档模型 -->
				<div id="tab1" class="tab-pane in tab1">
					<div class="form-item cf">
						<label class="item-label">选择跟进状态<span class="check-tips"></span></label>
						<div class="controls">
							<select name="status">
								<volist name=":C('CUSTOMER_FOLLOW_STATUS')" id="vo" key="k">
									<option value="{$k}">{$vo}</option>
								</volist>
							</select>
						</div>
					</div>
					<div class="form-item cf">
						<label class="item-label">文件ID<span class="check-tips">（需要函数处理）</span></label>
						<div class="controls">
							<div class="controls">
								<input type="file" id="upload_file_file_id">
								<input type="hidden" name="file_id" value="" />
								<div class="upload-img-box">
								</div>
							</div>
							<script type="text/javascript">
								//上传图片
								/* 初始化上传插件 */
								$("#upload_file_file_id").uploadify({
									"height": 30,
									"swf": "__STATIC__/uploadify/uploadify.swf",
									"fileObjName": "download",
									"buttonText": "上传附件",
									"uploader": "{:U('File/upload',array('session_id'=>session_id()))}",
									"width": 120,
									'removeTimeout': 1,
									"onUploadSuccess": uploadFilefile_id,
									'onFallback': function() {
										alert('未检测到兼容版本的Flash.');
									}
								});

								function uploadFilefile_id(file, data) {
									var data = $.parseJSON(data);
									if(data.status) {
										var name = "file_id";
										$("input[name=" + name + "]").val(data.data);
										$("input[name=" + name + "]").parent().find('.upload-img-box').html(
											"<div class=\"upload-pre-file\"><span class=\"upload_icon_all\"></span>" + data.info + "</div>"
										);
									} else {
										updateAlert(data.info);
										setTimeout(function() {
											$('#top-alert').find('button').click();
											$(that).removeClass('disabled').prop('disabled', false);
										}, 1500);
									}
								}
							</script>
						</div>
					</div>
					<div class="form-item cf">
						<label class="item-label">跟进时间</label>
						<div class="controls">
							<input type="text" class="text input-large date" name="follow_time" value=""> </div>
					</div>
					<div class="form-item cf">
						<label class="item-label">内容<span class="check-tips"></span></label>
						<div class="controls">
							<label class="textarea input-large">
                                <textarea name="content"></textarea>
                            </label>
						</div>
					</div>
				</div>
				<div class="form-item cf">
					<input type="hidden" name="customer_id" value="{:I('id')}" />
					<button class="btn submit-btn ajax-post hidden" id="submit" type="submit" target-form="form-horizontal">确 定</button>
					<a class="btn btn-return" href="/crm/admin.php?s=/article/index.html">返 回</a>
				</div>
			</form>
		</div>
	</div>

	</div>
	</div>
	<!-- /内容区 -->
	<script type="text/javascript">
		(function() {
			var ThinkPHP = window.Think = {
				"ROOT": "/crm", //当前网站地址
				"APP": "/crm/admin.php?s=", //当前项目地址
				"PUBLIC": "/crm/Public", //项目公共目录地址
				"DEEP": "/", //PATHINFO分割符
				"MODEL": ["3", "", "html"],
				"VAR": ["m", "c", "a"]
			}
		})();
	</script>

	<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
	<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
	<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
	<script type="text/javascript">
		$('#submit').click(function() {
			$('#form').submit();
		});

		$(function() {
			$('.date').datetimepicker({
				format: 'yyyy-mm-dd',
				language: "zh-CN",
				minView: 2,
				autoclose: true
			});
			$('.time').datetimepicker({
				format: 'yyyy-mm-dd hh:ii',
				language: "zh-CN",
				minView: 2,
				autoclose: true
			});
			showTab();
		});
	</script>

</block>